package funs

import "github.com/CocaineCong/secret"

//aes 对称加密和解密  还是直接使用secret包

// Ase加密签名
var specialSign = "afaf@zfayfafafdhffffaf-]_[;ldp#09@ffaf8,[2ps1zx;./"

// AesEncoding 加密  	//key := "458796" // key 密钥
func AesEncoding(key, encodeString string) string {
	aesEncrypt, _ := secret.NewAesEncrypt(specialSign, key, "", secret.AesEncrypt128, secret.AesModeTypeCTR)
	return aesEncrypt.SecretEncrypt(encodeString)
}

// AesDeCoding 解密
func AesDeCoding(key, decodeString string) string {
	aesEncrypt, _ := secret.NewAesEncrypt(specialSign, key, "", secret.AesEncrypt128, secret.AesModeTypeCTR)
	return aesEncrypt.SecretEncrypt(decodeString)
}
